#!/bin/bash
#注意：rabbitMQ的安装配置稍微麻烦一点，需要一定的耐心。如果出现了问题，建议搜索一下“rabbitMQ安装教程”。


yum -y install socat
pip install PyMySQL
pip install pika
wget https://github.com/rabbitmq/erlang-rpm/releases/download/v21.1.3/erlang-21.1.3-1.el7.centos.x86_64.rpm
rpm -ivh erlang-21.1.3-1.el7.centos.x86_64.rpm

wget https://github.com/rabbitmq/rabbitmq-server/releases/download/v3.7.9/rabbitmq-server-3.7.9-1.el7.noarch.rpm
rpm -ivh rabbitmq-server-3.7.9-1.el7.noarch.rpm

rabbitmq-plugins enable rabbitmq_management

systemctl start rabbitmq-server
systemctl enable rabbitmq-server

rabbitmqctl add_user  youseed youseed
rabbitmqctl set_user_tags youseed administrator
rabbitmqctl set_permissions -p / youseed '.*' '.*' '.*'